<template>
  <el-container>
    <el-header>
      <HeadNav @leftMenu="getLeftMenu" :adminObj="adminObj"></HeadNav>
    </el-header>
    <el-container style="min-height: min-content;">
      <el-aside width="200px">
        <LeftNav :index="index"></LeftNav>
      </el-aside>
      <el-main>
        <el-row class>
          <transition :name="transitionName">
            <keep-alive>
              <router-view class="transitionBody" ref="renewchild"></router-view>
            </keep-alive>
          </transition>
        </el-row>
      </el-main>
    </el-container>
  </el-container>
</template>
<script>
import HeadNav from "@/components/HeadNav.vue";
import LeftNav from "@/components/LeftNav.vue";
import tbsearch from "@/components/currency/tbsearch.vue";
import HeadTitle from "@/components/currency/HeadTitle.vue";
export default {
  components: {
    HeadNav,
    LeftNav,
    tbsearch,
    HeadTitle
  },
  data() {
    return {
      index: "",
      adminObj: "",
      transitionName: "transitionLeft"
    };
  },
  watch: {},
  methods: {
    getLeftMenu(index) {
      this.index = index;
    },
    getSendObj(obj) {
      this.adminObj = obj;
    },
    UpdateTB() {
      var that = this;
      try {
        that.$refs.renewchild.get_data();
      } catch (e) {
        that.$refs.renewchild.update_sort();
        return;
      }
    }
  }
};
</script>
<style lang="less" scoped>
.el-aside {
  background-color: #fff;
}
.transitionBody {
  transition: all 0.15s ease; /*定义动画的时间和过渡效果*/
}
.transitionLeft-enter,
.transitionRight-leave-active {
  -webkit-transform: translate(100%, 0);
  transform: translate(-100%, 0);
  /*当左滑进入右滑进入过渡动画*/
}
.transitionLeft-leave-active,
.transitionRight-enter {
  -webkit-transform: translate(-100%, 0);
  transform: translate(-100%, 0);
}
</style>
